﻿using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using DevExpress.XtraReports.UI;
using System.Windows.Forms;
using System.Data;

namespace QuanLyBanHang
{
    public partial class XtraReportDrillThroghtKH_HD : DevExpress.XtraReports.UI.XtraReport
    {
        public XtraReportDrillThroghtKH_HD()
        {
            InitializeComponent();
        }

        // Save the data for the current category to the label's Tag property.

        private void xrLabel1_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
        {
            ((XRLabel)sender).Tag = GetCurrentRow();

        }

        private void xrLabel1_PreviewClick(object sender, PreviewMouseEventArgs e)
        {
            // Create a new Detail Report instance.
            XtradetailhoadonReport detailReport = new XtradetailhoadonReport();

            // Obtain the current category's ID and Name from the e.Brick.Value property,
            // which stores an object assigned the label's Tag property.
            detailReport.KHid.Value = ((DataRowView)e.Brick.Value).Row["MaKH"];
            detailReport.KHNAME.Value = ((DataRowView)e.Brick.Value).Row["TenCty"].ToString();

            // Show the detail report in a new modal window.
            detailReport.ShowPreviewDialog();
        }

        // The following code changes the cursor to "hand" when it hovers the label, 
        // so that it behaves as a common link.
        private void xrLabel1_PreviewMouseMove(object sender, PreviewMouseEventArgs e)
        {
            Cursor.Current = Cursors.Hand;
        }

      
       

      

    }
}
